<?php
class Breakdown
{
/*
Created: October 23rd, 2007
*/
	/* Breakdown Class Attributes */
	var $UserID;
	var $UserName;
	var $Week;
	var $Game1;
	var $Game2;
	var $Game3;
	var $Game4;
	var $Game5;
	var $Game6;
	var $Game7;
	var $Game8;
	var $Game9;
	var $Game10;
	var $Game11;
	var $Game12;
	var $Game13;
	var $Game14;
	var $Game15;
	var $Game16;
	var $NumGames;
	var $WeekScore;
	

	/*
	Function: Breakdown($UserID='',$UserName='',$Week='',$Game1='',$Game2='',$Game3='',$Game4='',$Game5='',$Game6='',$Game7='',$Game8='',$Game9='',$Game10='',$Game11='',$Game12='',$Game13='',$Game14='',$Game15='',$Game16='',$NumGames='',$WeekScore='')
	Updated: October 23rd, 2007
	Description: Breakdown Class constructor.
	*/	
	function Breakdown($UserID='',$UserName='',$Week='',$Game1='',$Game2='',$Game3='',$Game4='',$Game5='',$Game6='',$Game7='',$Game8='',$Game9='',$Game10='',$Game11='',$Game12='',$Game13='',$Game14='',$Game15='',$Game16='',$NumGames='',$WeekScore='')
	{
		$this->UserID = $UserID;
		$this->UserName = $UserName;
		$this->Week = $Week;
		$this->Game1 = $Game1;
		$this->Game2 = $Game2;
		$this->Game3 = $Game3;
		$this->Game4 = $Game4;
		$this->Game5 = $Game5;
		$this->Game6 = $Game6;
		$this->Game7 = $Game7;
		$this->Game8 = $Game8;
		$this->Game9 = $Game9;
		$this->Game10 = $Game10;
		$this->Game11 = $Game11;
		$this->Game12 = $Game12;
		$this->Game13 = $Game13;
		$this->Game14 = $Game14;
		$this->Game15 = $Game15;
		$this->Game16 = $Game16;
		$this->NumGames = $NumGames;
		$this->WeekScore = $WeekScore;
	}/* End Breakdown() */	
	 
	//############################################################################
	
	/*
	Function: Display()
	Updated: October 23rd, 2007
	Description: Displays the Breakdown attributes for other user to see what the UserID wants,onmouseover=\"ShowContent('BreakdownDescDisplay'); return true;\"
	describe the Breakdown, where to get the Breakdown, etc..
	*/	
	function Display($row,$winners)
	{		
		echo "<tr bgcolor=\"".getRowColor($row)."\">";
		echo "<td><a href=\"members.php?ID=".$this->UserID."\" class=\"permLink\" title=\"See the profile on ".$this->UserName."\">".$this->UserName."</a></td>\n";
		for($j = 1; $j <= $this->NumGames; $j++)
		{
			//$pick = $myrow["Game".$j];
			$pick = $this->"Game".$j;

			if($winners[$j] != "-")
			{
				if($pick == $winners[$j])
					echo "<td width=\"40\" align=\"center\"><img src=\"../images/small/".$pick.".gif\" alt=\"".$pick."\" title=\"".$pick."\" border=\"0\" /></td>\n";
				else
					echo "<td width=\"40\" align=\"center\"><img src=\"../images/red-x.gif\" /></td>\n";
			}
			else
			{
				$InProgressResult = mysql_query("SELECT PickEmailed FROM NFLSchedule WHERE Week=".$this->Week." AND GameNum=".$j) or die("Cannot query the database.<br>" . mysql_error());
				$ProgressRow = mysql_fetch_array($InProgressResult);
				if($ProgressRow["PickEmailed"] == 1)
				{
					echo "<td width=\"40\" align=\"center\"><img src=\"../images/small/".$pick.".gif\" alt=\"".$pick."\" title=\"".$pick."\" border=\"0\" /></td>\n";
				}
				else
				{
					echo "<td width=\"40\" align=\"center\">&nbsp;</td>\n";
				}
			}
			
		}
		echo "<td align=\"center\"><span style=\"color: rgb(255, 0, 0); font-weight: bold; font-size: 16px;\">".$this->WeekScore."</span></td></tr>\n";

	}/* End Display() */  
   
} /* End Breakdown Class */
?> 